const enquirer = require("enquirer");
const clear = require("clear");
const chalk = require("chalk");
const figlet = require("figlet");

const moduleQuestions = () => {
  const questions = [
    {
      type: "select",
      name: "env",
      message: "请选择要切换的环境",
      choices: [
        "测试环境",
        "开发环境",
      ]
    },
    {
      type: "input",
      name: "suggestion",
      message: "有什么建议可以提供?"
    },
  ];

  enquirer.prompt(questions).then(ans => {
    clear();
    console.log(
      chalk.blueBright.bold(
        figlet.textSync("Env Switch", { horizontalLayout: "full" })
      )
    );
    console.log(
      chalk.cyanBright("\n\t 选择完成\n")
    );
    console.log(ans);
  });
};

module.exports = moduleQuestions;
